<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>ScrollAreaGadget</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">ScrollAreaGadget()</font></b></p>
<p><b>Syntax</b></p><blockquote>

Result = <font color="#006666"><b>ScrollAreaGadget</b></font>(#Gadget, x, y, Width, Height, ScrollAreaWidth, ScrollAreaHeight [, ScrollStep [, Flags]])</blockquote>

</blockquote>
<b>Description</b><br><blockquote>



Creates a ScrollArea gadget in the current GadgetList. It is a container for other gadgets with a scrollable area. 

 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Gadget</i></td>
<td width="90%"> 
 
A number to identify the new gadget. <a href="../reference/purebasic_objects.html">#PB_Any</a> can 
be used to auto-generate this number. 

 

</td></tr>
<tr><td><i>x, y, Width, Height</i></td>
<td> 
 
The position and dimensions of the new gadget. 

 

</td></tr>
<tr><td><i>ScrollAreaWidth, ScrollAreaHeight</i></td>
<td> 
 
The dimensions of the scrollable area inside the gadget. These can also be smaller than the outer dimensions, in 
this case scrolling will be disabled. 

 

</td></tr>
<tr><td><i>ScrollStep (optional)</i></td>
<td> 
 
The amount of pixels to scroll when the user presses the scroll bar arrows. 

 

</td></tr>
<tr><td><i>Flags (optional)</i></td>
<td> 
 
Flags to modify the gadget behavior. It can be a combination of the following values: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_ScrollArea_Flat</font>       : Flat frame
  <font color="#924B72">#PB_ScrollArea_Raised</font>     : Raised frame
  <font color="#924B72">#PB_ScrollArea_Single</font>     : Single sunken frame
  <font color="#924B72">#PB_ScrollArea_BorderLess</font> : Without any border
  <font color="#924B72">#PB_ScrollArea_Center</font>     : If the inner size is smaller than the outer, the inner area is automatically centered.
</font></pre>

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>



Returns nonzero on success and zero on failure. If <font color="#924B72">#PB_Any</font> was used as the #Gadget parameter 
then the return-value is the auto-generated gadget number on success. 

 

</blockquote><p><b>Remarks</b></p><blockquote>



Once the gadget is created, 
all future created gadgets will be created inside the scroll area. When all the needed 
gadgets have been created, <a href="closegadgetlist.html">CloseGadgetList()</a> must be called to return to the 
previous GadgetList. <a href="opengadgetlist.html">OpenGadgetList()</a> can be used later to add others gadgets 
on the fly in the scroll area. 
<br>
<br>
The following functions can be used to act on a ScrollAreaGadget: <br>
<br>
<a href="getgadgetattribute.html">GetGadgetAttribute()</a>: With one of the following attribute: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_ScrollArea_InnerWidth</font>  : Returns the width (in pixels) of the contained scrollable area.
  <font color="#924B72">#PB_ScrollArea_InnerHeight</font> : Returns the height (in pixels) of the contained scrollable area.
  <font color="#924B72">#PB_ScrollArea_X</font>           : Returns the current horizontal scrolling position (in pixels).
  <font color="#924B72">#PB_ScrollArea_Y</font>           : Returns the current vertical scrolling position (in pixels).
  <font color="#924B72">#PB_ScrollArea_ScrollStep</font>  : Returns the current scroll step value (in pixels).
</font></pre>
<a href="setgadgetattribute.html">SetGadgetAttribute()</a>: With one of the following attribute: 
 
<pre><font face="Courier New, Courier, mono"size="2">  <font color="#924B72">#PB_ScrollArea_InnerWidth</font>  : Changes the width (in pixels) of the contained scrollable area.
  <font color="#924B72">#PB_ScrollArea_InnerHeight</font> : Changes the height (in pixels) of the contained scrollable area.
  <font color="#924B72">#PB_ScrollArea_X</font>           : Changes the current horizontal scrolling position (in pixels).
  <font color="#924B72">#PB_ScrollArea_Y</font>           : Changes the current vertical scrolling position (in pixels).
  <font color="#924B72">#PB_ScrollArea_ScrollStep</font>  : Changes the current scroll step value (in pixels).
</font></pre>



This gadget supports the <a href="setgadgetcolor.html">SetGadgetColor()</a> and <a href="getgadgetcolor.html">GetGadgetColor()</a> functions with the 
<font color="#924B72">#PB_Gadget_BackColor</font> type to change the background color. 

 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 305, 140, "ScrollAreaGadget", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#006666">    ScrollAreaGadget</font>(0, 10, 10, 290,120, 375, 155, 30)
<font color="#006666">      ButtonGadget  </font>(1, 10, 10, 230, 30,"Button 1")
<font color="#006666">      ButtonGadget  </font>(2, 50, 50, 230, 30,"Button 2")
<font color="#006666">      ButtonGadget  </font>(3, 90, 90, 230, 30,"Button 3")
<font color="#006666">      TextGadget    </font>(4,130,130, 230, 20,"This is the content of a ScrollAreaGadget!",<font color="#924B72">#PB_Text_Right</font>)
<font color="#006666">      CloseGadgetList</font>()
    <b><font color="#006666">Repeat</font></b>
      <b><font color="#006666">Select</font></b> <font color="#006666">WaitWindowEvent</font>()
        <b><font color="#006666">Case</font></b>  <font color="#924B72">#PB_Event_CloseWindow</font>
          <b><font color="#006666">End</font></b>
        <b><font color="#006666">Case</font></b>  <font color="#924B72">#PB_Event_Gadget</font>
          <b><font color="#006666">Select</font></b> <font color="#006666">EventGadget</font>()
            <b><font color="#006666">Case</font></b> 1
<font color="#006666">              MessageRequester</font>("Info","Button 1 was pressed!",<font color="#924B72">#PB_MessageRequester_Ok</font>)
            <b><font color="#006666">Case</font></b> 2
<font color="#006666">              MessageRequester</font>("Info","Button 2 was pressed!",<font color="#924B72">#PB_MessageRequester_Ok</font>)
            <b><font color="#006666">Case</font></b> 3
<font color="#006666">              MessageRequester</font>("Info","Button 3 was pressed!",<font color="#924B72">#PB_MessageRequester_Ok</font>)
          <b><font color="#006666">EndSelect</font></b>
      <b><font color="#006666">EndSelect</font></b>
    <b><font color="#006666">ForEver</font></b>
  <b><font color="#006666">EndIf</font></b>
</font></pre>
<br>
<p><img src="../HelpPictures/scrollareagadget.png"></p>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="getgadgetattribute.html">GetGadgetAttribute()</a>, <a href="setgadgetattribute.html">SetGadgetAttribute()</a>, <a href="scrollbargadget.html">ScrollBarGadget()</a> 

</Blockquote><p><b>Supported OS  </b><Blockquote>All</Blockquote></p><center>&lt;- <a href=resizegadget.html>ResizeGadget()</a> - <a href=index.html>Gadget Index</a> - <a href=scrollbargadget.html>ScrollBarGadget()</a> -&gt;



</body></html>